/*************************************************************************
 *************************************************************************
 	 	 	 	 	 	 	M2SMA : GameEngine.cpp
 *************************************************************************
 *
 	 Copyright (C) 2008
 	 Steven Costiou, Julien Yven; Master 2 Complex Systems
 	 University of Western Brittany (UBO), Brest, France
 *
 *************************************************************************
 *************************************************************************
 *
 	 Copyright (C) 2011
 	 M2SMA reworked and simplified core, MWDM Minigames, France
 *
 **************************************************************************
 **************************************************************************
 *
	FILE COMMENT
 *
 **************************************************************************
 **************************************************************************
 *
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/
 *
 **************************************************************************
 **************************************************************************/

#include "GameEngine.h"

GameEngine::GameEngine()
{
	/// TODO : forbidden ?
}

GameEngine::GameEngine(int aSchedulerType) : Engine(aSchedulerType)
{
	initializeAttributes();
}

GameEngine::~GameEngine()
{
	delete sdlAgent;
}

GameEngine::GameEngine(const GameEngine& aGameEngine)
{

}

void GameEngine::initializeAttributes()
{
	//sdlAgent = new SDLAgent(this);
	//createAgentWithPriority(sdlAgent, LOW_PRIORITY);

	gameAgent = new DWGameAgent(this);
	createAgentWithPriority(gameAgent, LOW_PRIORITY);
}

SDL_Rect* GameEngine::requestScreenBounds()
{
	SDL_Rect* aRect = sdlAgent->getBounds();
	return aRect;
}

unsigned long int GameEngine::requestSubscriptionForDisplayStrokedOn(Basic2DGraphicAgent* aBasic2DGraphicAgent)
{
	return 0;
}

unsigned long int GameEngine::requestSubscriptionForDisplayFilledOn(Basic2DGraphicAgent* aBasic2DGraphicAgent)
{
	return 0;
}

unsigned long int GameEngine::requestSubscriptionForGraphicDisplay(DWGraphicAgent* aDWGraphicAgent)
{
	return sdlAgent->registerAgentForDisplay(aDWGraphicAgent);
}

void GameEngine::requestUnsubscriptionForStrokedOnDisplay(unsigned int anId)
{

}

void GameEngine::requestUnsubscriptionForFilledOnDisplay(unsigned int anId)
{

}

void GameEngine::requestUnsubscriptionForGraphicDisplay(unsigned int anId)
{

}
